Repository navigation
feat(cli): models catalog names the not-downloaded models this Mac can select - #1957
Merged
Merged
Conversation
`darkbloom models catalog` lists every catalog model but does not say which of the models that are not downloaded this Mac could select. These tests describe a note for that, printed under the table: - `ModelsCatalogHint.candidates`: the not-downloaded rows the start/switch picker would list and let this Mac select (active text model, listed `min_ram_gb` at most this Mac's memory, required runtime capabilities present, not hidden from the picker or replaced under a public alias, within the provider's load budget). - `ModelsCatalogHint.lines`: at most three rows with id and download size, what was not checked, and the commands. - `models catalog` prints the lines after its table from the one catalog request it already makes, which now also asks for the aliases; `--json` prints no note and its request is unchanged. `ModelsCatalogHint` is a stub that returns nothing, so the suite compiles and the new tests fail on their assertions. Co-Authored-By: Claude <noreply@anthropic.com>
…n select `darkbloom models catalog` printed every catalog model with its size and memory tier but left the owner to work out which of the models that are not downloaded the Mac could take. Under the table it now prints a short note: at most three such models with id and download size, what is not checked, and the commands to download one and to choose what to serve. `ModelsCatalogHint.candidates` runs the start/switch picker's own rules (runtime capabilities, public aliases, hidden builds) on the catalog, then keeps a row when it is not downloaded, active, lists a `min_ram_gb` at most this Mac's memory (the coordinator's comparison for a listed tier) and fits the provider's load budget alone. A model with no listed tier is left out rather than guessed. The note only prints. Nothing is downloaded, selected or saved, and no request is added: the table's one catalog request now also asks for the public aliases (`include_aliases=1`, as the picker does) so a build replaced under an alias is not named. The `--json` request and output are unchanged, and the note is left out when hardware detection fails. Free disk space, the memory reserve and memory in use at load time, the coordinator's minimum provider version and the provider's trust status are not checked; the note and the CLI reference say so. Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jonathan308
marked this pull request as ready for review
November 11, 2026 07:35
This was referenced Nov 12, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
darkbloom models catalognow ends with a short note naming the catalog models this Mac has not downloaded and that thestart/switchpicker would let it select, with each model's download size and the commands to add one. Owners can see which models their Mac qualifies for without comparing each listed tier with their hardware by hand.The note only prints. It downloads nothing, selects nothing and saves nothing, and it is absent from
--json.What an owner sees under the existing table (release build; example rows):
At most three models are listed, larger first as in the picker. With more, a fourth row reads
… and N more; the darkbloom switch picker lists them all. With no such model, or when hardware detection failed, nothing is printed.Linked issue
None.
Test plan
All local runs used
DARKBLOOM_RELEASE_ENVIRONMENT=prodas CI does and built theDarkbloomCLITeststarget only (swift build --build-testswith the other test targets removed in a local, uncommitted copy ofPackage.swift, thenswift test --skip-build --filter ...). No model weights, no GPU and no engine runs.swift test --skip-build --filter 'ModelsCatalogHintTests|ModelsCommandRunTests'gives 16 tests in 2 suites, 10 failing (the 8 new pure-function tests, the new command test, and the existing table test whose request assertion changed) and 6 passing.DarkbloomCLITeststarget on a5a0c71: 1451 tests in 195 suites, 11 failing tests, none in the two changed suites. The same 11 fail on the base 0f11fbe (1442 tests in 194 suites) on the same machine, which was busy with other builds: the cluster-pair start and restart tests, one stop-latch test, one helper-connection test and two sandbox child-output tests.make changelog-check,make changelog-preview,make docs-impact-check BASE=origin/dev,./scripts/docs-check.sh docs/provider/cli-reference.md,git diff --check.Components touched
Protocol / interface changes
No message, endpoint, config key or CLI flag changes, and no version bump. Two things worth knowing:
models catalognow carriesinclude_aliases=1. This is an existing catalog parameter that thestart/switchpicker's request already sends; the response has the samemodelslist plusaliases. The command still makes exactly one request, which a test asserts.--jsonrequest and its output are unchanged. A test asserts that the--jsonrequest has no query string and that its output has no note.Documentation impact
docs/provider/cli-reference.md, sectiondarkbloom models catalog: an example of the note, the rule that names a model, and what is not checked.Changelog
changelog.d/<topic>.mdfragment and ranmake changelog-check.Fragment:
changelog.d/models-catalog-not-downloaded-note.md.Notes for reviewers
How a model gets named.
ModelsCatalogHint.candidatesis a pure function. It reuses the picker's existing pure helpers instead of holding a second copy of their rules:Start.evaluateEligiblePickerCatalog: runtime capabilities (the catalog'srequired_provider_capabilitiesand the embedded exact-ID rules) and public aliases.Start.pickerCatalogRows: hidden, rollback and superseded builds.Start.buildPickerEntries: drops a not-downloaded model whosemin_ram_gbis above this Mac's memory, and orders larger first.activenot false, a listedmin_ram_gbabove zero, andStart.pickerSelectionFitsBudgetfor that model alone.How this relates to the coordinator's hardware gate. For a model with a listed tier the coordinator compares
min_ram_gbwith the Mac's total memory, and the note makes the same comparison. For a model without a listed tier the coordinator estimates from the model's size; the note does not copy that estimate and leaves those models out. The note is stricter than the tier in one respect: the model must also fit the provider's load budget on its own, because meeting the tier does not guarantee that the provider will load the weights.What it cannot check. Free disk space, the configured
memory_reserve_gband memory in use when a model loads, the coordinator's minimum provider version, and trust status. The printed text and the docs name these. On Macs with 16 to 36 GB the load gate can hold back up to about 2 GiB more than the picker's budget does; the picker has the same gap. This is why the header says "meets their listed requirements" and the docs say the note is not a promise that a model will download, load or receive requests.Placement. The note is on
models catalogand not onstatus:models catalogalready fetches the catalog, whilestatusmakes no catalog request, and adding one would put a network call on a command owners run often.--jsonis the way to get output without the note. There is no new flag.Size. 302 added lines: 78 source, 187 tests, 35 docs, 5 changelog.
Known limits, not addressed here.
switchuses what the running provider reports.if let.Nearby open work. An older open draft (number 1183, base
master) rewrites the "Local only" block directly above the new block inModelsCommand.swift; whichever lands second needs a small manual merge. Line 3 ofdocs/provider/cli-reference.md(Last updated) is edited by many open PRs and will conflict trivially.Repository-wide docs check.
make docs-checkover the whole repository reports three broken links intolibs/mlx-swift-lmfrom files this PR does not touch, because the clone used here has no submodule checkout. The changed file passes on its own.Before And After
Behavior:
flowchart TD subgraph Before B1["darkbloom models catalog"] --> B2["one catalog request"] B2 --> B3["Supported models table: downloaded mark, size, listed RAM tier, capability lines"] B3 --> B4["Local only block, when there is one"] B4 --> B5["End of output: the owner compares each tier with the Mac by hand"] end subgraph After A1["darkbloom models catalog"] --> A2["the same one request, now with include_aliases=1"] A2 --> A3["Supported models table, unchanged"] A3 --> A4["Local only block, unchanged"] A4 --> A5{"Hardware detected and at least one model to name?"} A5 -- yes --> A6["Not downloaded note: up to three rows, what is not checked, two commands"] A5 -- no --> A7["Nothing more is printed"] endCode flow:
flowchart TD R["Models.Catalog.run"] --> F["ModelCatalogClient.fetchCatalogSnapshot, includeAliases only without --json"] F --> J{"--json?"} J -- yes --> JO["printJSON of the models, as before"] J -- no --> T["Table and Local only block, as before"] T --> H{"snapshot.hardware present?"} H -- no --> E["return"] H -- yes --> C["ModelsCatalogHint.candidates, pure"] C --> P1["Start.evaluateEligiblePickerCatalog: capabilities and aliases"] P1 --> P2["Start.pickerCatalogRows: hidden and superseded builds"] P2 --> P3["Start.buildPickerEntries: listed tier against memory, larger first"] P3 --> P4["Filter: not downloaded, active, listed tier, pickerSelectionFitsBudget alone"] P4 --> L["ModelsCatalogHint.lines, pure"] L --> O["print each line"]Refactor Pass
An independent read-only review of the diff (it compiled nothing) raised four points, all applied before the final commit:
candidatestakes them;aliasedBuildscovers the desired, previous and retired builds.memory_reserve_gb.forEachwithprintbecame aforloop like its neighbours.Final focused validation after these changes: 16 of 16 tests in the two changed suites pass on a5a0c71.
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.